//
//  YXPopupListTVCell.m
//  YXPopList_Example
//
//  Created by GMS on 2020/5/18.
//  Copyright © 2020 Arthur. All rights reserved.
//

#import "YXPopupListTVCell.h"

@interface YXPopupListTVCell ()

// MARK: 用于显示内容
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;


@end

@implementation YXPopupListTVCell

+ (instancetype)popupListTableViewCellWith:(UITableView *)tableView
andCommentModel:(id)model {
    
    YXPopupListTVCell *cell = [tableView dequeueReusableCellWithIdentifier:@"YXPopupListTVCell"];
    if (!cell) {
        cell = [[[NSBundle mainBundle] loadNibNamed:@"YXPopupListTVCell" owner:self options:nil] objectAtIndex:0];
        [cell updateCellWithModel:model];
        cell.selectedBackgroundView = [[UIView alloc] initWithFrame:cell.frame];
        cell.selectedBackgroundView.backgroundColor = [UIColor colorWithRed:0 green:255 blue:255 alpha:1];
    }
    return cell;
}

- (void)updateCellWithModel:(id)model {
    
    if ([model isKindOfClass:[NSString class]]) {
        self.contentLabel.text = (NSString *)model;
    }
}

- (void)awakeFromNib {
    [super awakeFromNib];
    
    
    
    
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
